From 1a7802cf0b6380aea188ce24c0624abe3ad3405e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 7 Oct 2025 20:08:39 +0200 Subject: [PATCH] notificationDaemon: Do not send activation event multiple times When a FDO notification is updated we reuse the previous instance, however we do not care about disconnecting the default activation signal and thus we may end up emitting the same multiple times, even in the case the updated notification has no action at all. So track the signal connections. Part-of: --- js/ui/notificationDaemon.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 3d9edaceb..de99e158d 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -193,6 +193,7 @@ class FdoNotificationDaemon { break; } this._emitNotificationClosed(id, notificationClosedReason); + notification.disconnectObject(this); }); } @@ -210,6 +211,7 @@ class FdoNotificationDaemon { acknowledged: false, }); notification.clearActions(); + notification.disconnectObject(this); let hasDefaultAction = false; @@ -228,14 +230,14 @@ class FdoNotificationDaemon { } if (hasDefaultAction) { - notification.connect('activated', () => { + notification.connectObject('activated', () => { this._emitActivationToken(source, id); this._emitActionInvoked(id, 'default'); - }); + }, this); } else { - notification.connect('activated', () => { + notification.connectObject('activated', () => { source.open(); - }); + }, this); } switch (hints.urgency) { -- 2.39.5